Código fuente de 'Obtiene path del fichero.asp'

<html>
<head>
<title>Obtiene path del fichero - Códigos asp, programacion asp, descargas asp, rutinas asp</title>
</head>
<p align="center"><b><font size="3">Obtiene path del fichero</font></b></p>


<SCRIPT Language=VBScript RUNAT=SERVER>
Function getFilePath()
  Dim lsPath, arPath

  ' Obtain the virtual file path. The SCRIPT_NAME
  ' item in the ServerVariables collection in the
  ' Request object has the complete virtual file path
  lsPath = Request.ServerVariables("SCRIPT_NAME")
    
  ' Split the path along the /s. This creates an
  ' This creates an one-dimensional array 
  arPath = Split(lsPath, "/")

  ' Set the last item in the array to blank string
  ' (The last item actually is the file name)
  arPath(UBound(arPath,1)) = ""

  ' Join the items in the array. This will
  ' give you the virtual path of the file
  GetFilePath = Join(arPath, "/")
End Function
</SCRIPT>
<%  response.write "El nombre del path del fichero actual desde la raíz es: <i>" & GetFilePath  & "</i>" %>
</body>
</html>